package com.itheima.controller;

import com.itheima.pojo.User;
import com.itheima.service.UserSerivce;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class UserController {
@Autowired
    private UserSerivce userSerivce;
/*@Autowired
    public UserController(UserSerivce userSerivce) {
        this.userSerivce = userSerivce;
    }*/
    @RequestMapping("/list")
public List<User> list(){
        List<User> userList = userSerivce.findAll();
        return userList;
    }

}
